#ifndef	__KYLIN_LICENSE_H__
#define	__KYLIN_LICENSE_H__

/*
 * kylin_get_license, get license information in vikey
 *   ukey_license_keyfile - LICENSE文件
 *   data - LICENSE 数据的首地址
 * return NO_ERROR if succeed, or error number if not
 */

int kylin_get_license(GKeyFile** ukey_license_keyfile, const char *data);

/*
 * kylin_get_license_value, get license information by key in Usb Key
 * key: key string
 * return value string if succeed, or NULL if not
 */
char* kylin_get_license_value(GKeyFile* ukey_license_keyfile, const char *data, char* key);

/*
 * kylin_get_license_serial, get serial string in license information
 * return value string if succeed, or NULL if not
 */
char* kylin_get_license_serial(GKeyFile* ukey_license_keyfile, const char *data);

/*
 * kylin_get_license_expire, get expire date string in license information
 * return value string if succeed, or NULL if not
 */
char* kylin_get_license_expire(GKeyFile* ukey_license_keyfile, const char *data);

/*
 * kylin_get_license_to, get destination string in license information
 * return value string if succeed, or NULL if not
 */
char* kylin_get_license_to(GKeyFile* ukey_license_keyfile, const char *data);

/*
 * kylin_get_license_produce, get produce string in license information
 * return value string if succeed, or NULL if not
 */
char* kylin_get_license_produce(GKeyFile* ukey_license_keyfile, const char *data);

/*
 * kylin_get_license_count, get count value in license information
 */
int kylin_get_license_count(GKeyFile* ukey_license_keyfile, const char *data);

/*
 * kylin_find_register_code, search for register code in vikey
 * return 1 if found, or 0 if not
 */
int kylin_find_register_code(const char* register_code, const char* buf, size_t size);

/*
 * kylin_check_register_code_space_validation, try to find a empty place in vikey for register code
 * return the first index of empty place in vikey
 */
int kylin_check_register_code_space_validation(const char* buf, const size_t size);


#endif
